#!/usr/bin python3
# -*- coding: utf-8 -*-

if __name__ == '__main__':
    n = int(input())

    cost = []
    for i in range(n):
        cost.append([int(i) for i in input().split(' ')])

def min_heap(init):
    if init == 0:
        return [1, 2]
    elif init == 1:
        return [0, 2]
    elif init == 2:
        return [0, 1]

def create_heap(init, t):
    tree = []
    for i in range(t):
        